home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u304.dms / in.adf / bits / doscall.AMOS / doscall.amosSourceCode < prev   
Encoding:
AMOS Source Code  |  1992-03-22  |  912 b   |  34 lines

  1. ' M. R. N. Arnold (c)opyright 1992.
  2. '  
  3. ' How to call a DOS function from AMOS, Someink that the farking manual
  4. ' should tell ya but they couldnt be bothered, or maybe there incapable of 
  5. ' writing a few lines of machine code!??!?!!!!!!!!!! 
  6. '
  7. Reserve As Work 14,200 : Rem Reserve a bank to shove the command line in! 
  8. Screen Open 0,640,200,2,Hires : Rem Boring but QUICK screen! 
  9. Paper 0 : Pen 1 : Cls : Colour 1,$CCC : ER=0 : Rem My Fave Preferences! 
  10. Curs On 
  11. '
  12. For F=1 To 20 : Print : Next F
  13. Do 
  14. Line Input "Command =>";X$
  15. '
  16. EXECUTE[X$]
  17. Print 
  18. Loop 
  19. '
  20. '
  21. ' This is the main EXECUTE procedure which is a short machine code routine 
  22. ' which calls to dos your command, the machine code is stored in bank, er
  23. ' hangon.......Yep...Bank 15 and is a kewl 88 bytes long...Wow!  
  24. '  
  25. Procedure EXECUTE[X$]
  26. A=Start(14)
  27. For F=1 To Len(X$)
  28. Poke A,Asc(Mid$(X$,F,1))
  29. Inc A
  30. Next F
  31. Poke A,0
  32. Dreg(4)=Start(14)
  33. Call 15
  34. End Proc